<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <form action="">
      用户名：<input type="text" class="username" /> 
      密码：<input type="text"class="pwd">
      <input type="checkbox" class="hobbys" checked />唱跳
      <input type="checkbox" class="hobbys" checked />rap
      <input type="checkbox" class="hobbys" />打篮球 
      <button>提交</button>
    </form>
    <script>
      let name = document.querySelector(".username");
      name.value = "admin";
      let pwd = document.querySelector(".pwd");
      pwd.value = "123456";
      let hobbys = document.querySelectorAll(".hobbys");
      console.log(hobbys);
      hobbys[0].checkd = true;
      hobbys[1].checkd = true;
      document.querySelector("button").disabled = true;
    </script>
  </body>
</html>
